from itertools import chain

# 不同集合上元素的迭代，想在多个对象执行相同的操作，但这些对象在不同的容器中
def demo_1():
    a = [1,2,3]
    b = ["x","y","z"]
    c = ["a","b","c"]
    # chain函数针对当想对不同集合中所有元素执行某些操作，相比于多次遍历多个集合更优雅
    for l in chain(a, b, c):
        print(l)

if __name__ == '__main__':
    demo_1()